<!DOCTYPE html>
<html class="um landscape min-width-240px min-width-320px min-width-480px min-width-768px min-width-1024px">
    <head>
        <title></title>
        <meta charset="utf-8">
        <meta name="viewport"
        content="target-densitydpi=device-dpi, width=device-width, initial-scale=1.0, user-scalable=no" />
        <link rel="stylesheet" type="text/css" href="css/index.css">
        <link rel="stylesheet" href="css/ui-base.css">
        <link rel="stylesheet" href="css/ui-box.css">
        <link rel="stylesheet" href="css/ui-color.css">
        <link rel="stylesheet" href="css/ui-res.css">
        <link rel="stylesheet" href="css/ui-btn.css">
        <link rel="stylesheet" href="css/index.css">
        <script type="text/javascript">
            function xmlHttpGet() {
                var url = document.getElementById('add').value;
                uexXmlHttpMgr.open("1", "get", url, "");
                uexXmlHttpMgr.send("1");
                // 开启
                uexWindow.toast(1, 5, "加载中...", 0);
            }

            function httpSuccess(opid, state, result) {
                uexXmlHttpMgr.close(opid);
                uexWindow.closeToast();
                if (state == 0) {// Receive
                    alert("接收到");
                } else if (state == -1) {//出错
                    // 当url有错误的时候会出错，或者url失效了（比如，服务器关掉了）
                    
                    alert("出错了");
                } else if (state == 1) {// finish
                    if (opid == 1) {
                        alert("这里");
                        document.getElementById('adre').innerHTML = "opCode:" + opid + "<br> state:" + state + "<br> result:" + result;
                    }
                }
            }


            window.uexOnload = function() {
                uexXmlHttpMgr.onData = httpSuccess;
                uexWidgetOne.cbError = function(opCode, errorCode, errorInfo) {
                    alert("errorCode:" + errorCode + "\nerrorInfo:" + errorInfo);
                }
            }
        </script>
    </head>
    <body class="um-vp " ontouchstart>
        <div class="conbor">
            <p>
                跨域异步请求接口测试：
            </p>
            <p>
                1.GET
            </p>
            http://192.168.0.2/
            http://221.7.204.182:8016/ovm/app.php/Home/Public/login/nick_name/zqy/pwd/zqy
            <input class="textbox" type="text" id="add" value="http://192.168.0.2/">
            <input class="btn" type="button" value="取数据" onclick=xmlHttpGet()>
            <span>请求结果：</span>
            <div class="tcxx" id="adre"></div>
        </div>
    </body>
    <script></script>
</html>
